package com.bt7274.pojo;


import java.time.LocalDate;
import java.time.LocalDateTime;
import lombok.Data;

/**
 * 用户每日签到记录表
 * @TableName user_daily_check_in
 */
@Data
public class UserDailyCheckIn {
    /**
     * 
     */
    private String id;

    /**
     * 用户ID
     */
    private String userId;

    /**
     * 签到日期
     */
    private LocalDate checkInDate;

    /**
     * 连续签到天数
     */
    private Integer consecutiveDays;

    /**
     * 获得的奖励
     */
    private Integer reward;

    /**
     * 签到时间
     */
    private LocalDateTime checkInTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        UserDailyCheckIn other = (UserDailyCheckIn) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getCheckInDate() == null ? other.getCheckInDate() == null : this.getCheckInDate().equals(other.getCheckInDate()))
            && (this.getConsecutiveDays() == null ? other.getConsecutiveDays() == null : this.getConsecutiveDays().equals(other.getConsecutiveDays()))
            && (this.getReward() == null ? other.getReward() == null : this.getReward().equals(other.getReward()))
            && (this.getCheckInTime() == null ? other.getCheckInTime() == null : this.getCheckInTime().equals(other.getCheckInTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getCheckInDate() == null) ? 0 : getCheckInDate().hashCode());
        result = prime * result + ((getConsecutiveDays() == null) ? 0 : getConsecutiveDays().hashCode());
        result = prime * result + ((getReward() == null) ? 0 : getReward().hashCode());
        result = prime * result + ((getCheckInTime() == null) ? 0 : getCheckInTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", checkInDate=").append(checkInDate);
        sb.append(", consecutiveDays=").append(consecutiveDays);
        sb.append(", reward=").append(reward);
        sb.append(", checkInTime=").append(checkInTime);
        sb.append("]");
        return sb.toString();
    }
}